REALY = 0
gpio.mode(REALY, gpio.OUTPUT)
COUNTER = 0
function relay_act()
COUNTER = COUNTER + 1
if(COUNTER % 2 == 0) then
gpio.write(REALY, gpio.HIGH)
else
gpio.write(REALY, gpio.LOW)
end
print("----Relay action")
end
tmr.register(0, 5000, tmr.ALARM_AUTO, relay_act)
tmr.start(0)
|